import {App} from "vue";
import locale from 'element-plus/lib/locale/lang/zh-cn'
import {
    ElAvatar,
    ElContainer,
    ElAside,
    ElMain,
    ElHeader,
    ElUpload,
    ElBreadcrumb,
    ElBreadcrumbItem,
    ElSubMenu,
    ElButton,
    ElCol,
    ElRow,
    ElSpace,
    ElCard,
    ElDropdown,
    ElDialog,
    ElMenu,
    ElMenuItem,
    ElDropdownItem,
    ElDropdownMenu,
    ElIcon,
    ElInput,
    ElForm,
    ElFormItem,
    ElLoading,
    ElPopover,
    ElPopper,
    ElTooltip,
    ElSelect,
    ElOption,
    ElCheckboxGroup,
    ElCheckbox,
    ElScrollbar,
    ElSkeleton,
    ElTable,
    ElTableColumn,
    ElAlert,
    ElDivider,
    ElTabs,
    ElTabPane,
    ElRadio,
    ElRadioGroup,
    ElDatePicker,
    ElSwitch,
    ElTag,
    ElTree,
    ElCollapse,
    ElCollapseItem,
    ElPopconfirm,
    ElPagination,
    ElRadioButton,
    ElDescriptions,
    ElDescriptionsItem,
    ElAutocomplete,
    ElTimePicker,
    ElInputNumber,
    ElImage
    
} from "element-plus";

const components = [
    ElContainer,
    ElAside,
    ElMain,
    ElHeader,
    ElPopconfirm,
    ElCollapse,
    ElCollapseItem,
    ElTag,
    ElTree,
    ElSwitch,
    ElDatePicker,
    ElRadio,
    ElRadioGroup,
    ElTabs,
    ElDivider,
    ElAlert,
    ElTableColumn,
    ElTable,
    ElScrollbar,
    ElUpload,
    ElSkeleton,
    ElBreadcrumb,
    ElBreadcrumbItem,
    ElSubMenu,
    ElButton,
    ElCol,
    ElRow,
    ElSpace,
    ElCard,
    ElDropdown,
    ElDialog,
    ElMenu,
    ElMenuItem,
    ElDropdownItem,
    ElDropdownMenu,
    ElIcon,
    ElInput,
    ElForm,
    ElFormItem,
    ElPopover,
    ElPopper,
    ElTooltip,
    ElSelect,
    ElOption,
    ElCheckboxGroup,
    ElCheckbox,
    ElAvatar,
    ElRadioButton,
    ElDescriptions,
    ElDescriptionsItem,
    ElAutocomplete,
    ElTimePicker,
    ElInputNumber,
    ElTabPane,
    ElImage
    
];

import {
    LocationInformation,
    UserFilled,
    Star,
    List,
    Fold,
    Expand,
    Management,
    InfoFilled,
    Edit,
    Delete,
    VideoPlay,
    Clock,
    Document,
    Goods,
    User,
    Tickets,
    Iphone,
    OfficeBuilding,
    Location,
    GoodsFilled,
    Search,
    Refresh,
    Plus,
    ArrowDown,
    Pointer,
    DataBoard,
    SwitchButton
  
} from '@element-plus/icons-vue'

const iconArry = [

    LocationInformation,
    UserFilled,
    Star,
    List,
    Fold,
    Expand,
    Management,
    InfoFilled,
    Edit,
    Delete,
    VideoPlay,
    Clock,
    Document,
    Goods,
    User,
    Tickets,
    Iphone,
    OfficeBuilding,
    Location,
    GoodsFilled,
    Search,
    Refresh,
    Plus,
    ArrowDown,
    Pointer,
    DataBoard,
    SwitchButton,
 
   

]



const plugins = [ElPagination, ElLoading];
export function useElementPlus(app: App) {
    components.forEach((component) => {
        app.component(component.name, component);
    });
    plugins.forEach((plugin) => {
        app.use(plugin);
    });
    iconArry.forEach(
        (icon) =>{
            app.component(icon.name,icon)
        }
    );
    
}